<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Cate_id')}:</label>
        <div class="col-xs-12 col-sm-8">
            {:build_select('row[cate_id]', $ruledata, null, ['class'=>'form-control', 'required'=>''])}
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-title" class="form-control" name="row[title]" type="text">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label>
        <div class="col-xs-12 col-sm-8">
            <select id="c-type" class="form-control" name="row[type]">
                <option value="1">单选</option>
                <option value="2">多选</option>
            </select>
        </div>
    </div>
    <div class="form-group" id="appenddiv">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-2">
            <!--<span onclick="addOption();">增加选项</span>-->
            <a href="#" id="AddMoreFileBox" class="btn btn-info">增加选项</a></span></p>
        </div>
        <div id="InputsWrapper" style="position: relative;top: 60px;float: left;">
            <!--<div><input type="text" name="mytext[]" id="field_1" value="Text 1"/><a href="#" class="removeclass"><input type='button' value='删除'></a></div>-->
        </div>
    </div>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
<script src='http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js'></script>
<script>
    $(document).ready(function() {

        var InputsWrapper   = $("#InputsWrapper"); //Input boxes wrapper ID
        var AddButton       = $("#AddMoreFileBox"); //Add button ID

        var x = InputsWrapper.length; //initlal text box count
        var FieldCount=1; //to keep track of text box added

        $(AddButton).click(function (e)  //on add input button click
        {
                FieldCount++; //text box added increment
                //add input box
                var html ="<div style='margin: 3px;'>" +
                    "<span>选项:</span><input type=\"text\" name=\"row[option]['"+(FieldCount-1)+"']\" />" +
                    "&nbsp;&nbsp;<span>价格:</span><input type=\"text\" name=\"row[money]['"+(FieldCount-1)+"']\" />" +
                    "<a href=\"#\" class=\"removeclass\">" +
                    "<input type=\"button\" value=\"删除\">" +
                    "</a>" +
                    "</div>";
                $(InputsWrapper).append(html);
                x++; //text box increment


        });

        $("body").on("click",".removeclass", function(e){ //user click on remove text
                $(this).parent('div').remove(); //remove text box
                x--; //decrement textbox
        })

    });

</script>